package com.aco.party.web.validator.system;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.aco.party.web.command.system.EditRoleCommand;

public class EditRoleValidator implements Validator {

	public boolean supports(Class<?> clazz) {
		
		return EditRoleCommand.class.isAssignableFrom(clazz);
	}

	public void validate(Object target, Errors errors) {
		ValidationUtils.rejectIfEmpty(errors, "name", "name.empty", "角色名不能为空！");
	}
	
}
